import request from "@/api/axios";
import {DEFAULT_PAGENUM, DEFAULT_PAGESIZE} from "@/constent";

/**
 * 删除文件,添加回收站
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const addRecycle = (data) => {
    return request.post('/recycle/addRecycle',data);
}

/**
 * 获得回收站列表
 * @param pageNum
 * @param pageSize
 * @returns {AxiosPromise}
 */
export const recycleList = (pageNum = DEFAULT_PAGENUM, pageSize = DEFAULT_PAGESIZE) => {
    return request({
        url:'/recycle/recycleList',
        method:'get',
        params:{
            pageNum,
            pageSize
        }
    })
}

/**
 * 永久删除回收站文件
 * @param id
 * @returns {AxiosPromise}
 */
export const recycleRemove = (id) => {
    return request({
        url:'/recycle/recycleRemove',
        method:'get',
        params:{
            id
        }
    })
}
/**
 * 恢复回收站文件
 * @param id
 * @returns {AxiosPromise}
 */
export const recycleRecovery = (id) => {
    return request({
        url:'/recycle/recycleRecovery',
        method:'get',
        params:{
            id
        }
    })
}

/**
 * 清空回收站文件
 * @param id
 * @returns {AxiosPromise}
 */
export const recycleClear = () => {
    return request({
        url:'/recycle/recycleClear',
        method:'get'
    })
}

/**
 * 获取回收站数据详情
 * @param id
 * @returns {AxiosPromise}
 */
export const getRecycleInfo = (id) => {
    return request({
        url:'/recycle/getRecycleInfo',
        method:'get',
        params:{
            id
        }
    })
}


